﻿@using ReportViewerForMvc;
@using Apps.Web.Core;
@using Apps.Locale;
@{
    ViewBag.Title = "进厂煤台账";
    Layout = "~/Views/Shared/_Index_Layout.cshtml";
}
<script src="~/Scripts/My97DatePicker/WdatePicker.js"></script>
<script src="~/Scripts/common.js"></script>
<form id="form1">
    <div class="mvctool">
        <select class="easyui-combobox" name="MATERIEL_ID" id="MATERIEL_ID" style="width:200px;"></select>
        <input type="text" class="input Wdate" style="width:105px" name="STime" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', maxDate: '#F{$dp.$D(\'ETime\')}' })" id="STime" value="@ViewBag.STime" placeholder="开始日期">
        <input type="text" class="input Wdate" style="width:105px" name="ETime" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', minDate: '#F{$dp.$D(\'STime\')}' })" id="ETime" value="@ViewBag.ETime" placeholder="结束日期">
        @Html.ToolButton("btnQuery", "fa fa-search", Resource.Query, "Query", true)
    </div>
</form>

@Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer, new { @id = "mainiframe", @width = "100%", @height = "100%", onload = "changeFrameHeight()" }, "CaculateReportWebForm")

<script type="text/javascript">
    function changeFrameHeight() {
        var ifm = document.getElementById("mainiframe");
        ifm.height = document.documentElement.clientHeight-50;
    }
    $(function () {
        window.onresize = function () {
            changeFrameHeight();
        }
        
        GetTranSuppList(2, "@ViewBag.MATERIEL_ID");
    });

    $("#btnQuery").click(function () {
        $("#form1").submit();
    });

</script>